<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateJsonFieldsTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('json_fields', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('table_id')->default(0)->nullable()->unsigned()->comment('表名');
            $table->integer('table_field_id')->default(0)->nullable()->unsigned()->comment('字段名');
            $table->string('schema', 100)->nullable()->comment('语法(JSON)');
            $table->string('data')->nullable()->comment('数据');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('json_fields');
    }
}
